import axios from "axios"
//得到该宠物主的所有宠物
export async function getPet(value,text,masterId){

    // 使用代理
    var resp = await axios.get('/api/pet_sys/pet',{
        params:{
            value,
            text,
            masterId
        }
    });

    return resp;
}
export async function deletePet(petId){

    // 使用代理
    var resp = await axios.get('/api/pet_sys/pet',{
        params:{
            method:"delete",
            petId
        }
    });

    return resp;
}
export async function addPet(pet,masterId){

    // 使用代理
    var resp = await axios.get('/api/pet_sys/pet',{
        params:{
            method:"add",
            masterId,
            petName:pet.petName,
            petRace:pet.petRace,
            petType:pet.petType,
            petColor:pet.petColor,
            petBirthday:pet.petBirthday,
            petCharacter:pet.petCharacter,
            
        }
    });

    return resp;
}
export async function updataPet(pet){

    // 使用代理
    var resp = await axios.get('/api/pet_sys/pet',{
        params:{
            method:"update",
            petId:pet.petId,
            petName:pet.petName,
            petRace:pet.petRace,
            petType:pet.petType,
            petColor:pet.petColor,
            petBirthday:pet.petBirthday,
            petCharacter:pet.petCharacter,
            
        }
    });

    return resp;
}